package com.base.cn.platform.os.common.constants;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

/**
 * 通用常量对象
 *
 * @author s.li
 * @create 2018-03-06 18:44
 */
@Configuration
public class CommonConstants {
    public static final ThreadLocal<String> threadLocal = new ThreadLocal<>();
    public static final String VERSION = String.valueOf(System.currentTimeMillis());
    //租户ID属性名7

    public static final String TENANT_ID_NAME="tenantId";
    @Autowired
    private Environment environment;
    /**用户登录成功后缓存在Cookie中标签KEY*/
    public static final String ADMIN_LOGIN_COOKIE = "sin";

    public static final String STATIC_PATH = "static.path";
    public static final String UPLOAD_PATH = "res.path";
    public static final String MOBILE_PATH = "mobile.path";
    public static final String WEB_PATH = "web.path";
    public static final String ADMIN_PATH = "admin.path";
    public String get(String name){
        return environment.getProperty(name,"");
    }
    public static final String REDIRECT = "redirect";
    // 用户登录
    public static final String USER_SINGLE_ID = "sid"; // 用户id
    public static final String MOBILE_USER_SINGLE_ID = "msid"; // 用户id
    //前台用户临时缓存，用于完善资料前
    public static final String TEMPORARY_USER_SINGLE_ID_PREFIX="templrary_user_single_";

    public static final String  NO_MOBILE = "noMobile"; //  用于h5请求身份识别

}
